package com.yc.so.view.impl;

import com.yc.so.bin.SoBoundsConfigurator;
import com.yc.so.utils.BoundsCalculationUtil;
import com.yc.so.view.SoView;
import javafx.scene.Node;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;

public class DataDisplayView implements SoView {
    public AnchorPane getView() {
        return organizationView();
    }

    /**
     * 视图组织
     * @return
     */
    private AnchorPane organizationView(){
        SoBoundsConfigurator bounds = BoundsCalculationUtil.getDataDisplayBounds();
        System.out.println("DataDisplayView::"+bounds);
        return getAnchorPane(bounds);
    }

    private AnchorPane getAnchorPane(SoBoundsConfigurator bounds) {
        AnchorPane anchorPane=new AnchorPane();
        anchorPane.setPrefWidth(bounds.getWidth());
        anchorPane.setPrefHeight(bounds.getHeight());
        anchorPane.setLayoutY(bounds.getY());
        anchorPane.setStyle("-fx-background-color: #1A1A24;");
        return anchorPane;
    }
}
